/**
 * Created by gaocai on 16/9/19.
 */
import React, {Component} from 'react';
import {Provider} from 'react-redux';
import { MtNavBar } from 'martian-ui';
import configureStore from '../store/configureStore'
import {
  AppState, StyleSheet, StatusBar, View, NativeAppEventEmitter, Platform,
  Navigator, Alert, AsyncStorage, NetInfo, NativeModules,
} from 'react-native';
import Home from '../container/home'



class App extends Component {
  constructor() {
    super();
    this.state={
      store: {},
      isLoading: true,
    }
  }

  componentWillMount() {

  }
  componentDidMount() {

    configureStore(data => this.setState({ isLoading: false, store: data })).done();
  }
    render() {
      const {store } = this.state;
      if (this.state.isLoading) {
        return Platform.OS === 'ios' ? <StatusBar hidden={true} /> : null;
      }
        return (

          <View style={styles.container}>
            <Provider store={this.state.store}>
                <Home />
            </Provider>
            </View>
        )
    }

}

export default App;

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});
